Skip to content

Conversation

@Jagdish-Singh-Bisht
Copy link

This PR addresses LANG-1806 as a small follow-up to LANG-1695.

NumberUtils.isParsable currently rejects strings such as "1.f" and "1.d", even though Float.parseFloat("1.f") and Double.parseDouble(1.d") succeed.

The test suite already contained TODOs for these cases, this change uncomments those assertions and updates the parsing logic to allow floating-point suffixes (f/F/d/D) only when they appear as the final character.

The change is intentionally minimal and doesn not affect other numeric formats.

Copy link
Member

@garydgregory garydgregory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Jagdish-Singh-Bisht

This PR doesn't handle:

  • 1.2e-5d
  • 1.2e-5f

You did not follow the instructions in the PR template:

  • Run mvn
  • Fix all errors
  • Also remove the extra blank lines.

Rebase on git master where I added test TODOs for the above.

@Jagdish-Singh-Bisht
Copy link
Author

Thanks for the review.

Understood regarding the scientific notation cases (1.2e-5d / 1.2e-5f).
I'll rebase on current master, address those cases, clean-up formatting, and confirm mvn test before updating the PR.

@Jagdish-Singh-Bisht Jagdish-Singh-Bisht force-pushed the LANG-1806-numberutils-suffix branch from 1ad007d to 5e48311 Compare January 3, 2026 03:39
@Jagdish-Singh-Bisht
Copy link
Author

Thanks for the review and guidance.

I have rebased on the latest master, cleaned up formatting, and verified the build with mvn test.

This PR intentionally limits the scope to suffix-only cases(2.f, 2.d) as a minimal follow-up to LANG-1695.
The cases (1.2e-5f, 1.2e-5d) remain as TODOs added on master, since they would require additional exponent-parsing logic
and may be better addressed separately.

Please let me know if you'd prefer those cases to be handled in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants